import request from '@/utils/request'
import upload from '@/utils/upload'

// 获取文档分页数据
export function page(data) {
	return request({
		url: '/h5/doc/page',
		'method': 'get',
		'data': data
	})
}

// 获取page页面tab数据
export function tabList() {
	return request({
		url: '/h5/doc/tab',
		'method': 'get'
	})
}

// 获取detail页面数据
export function getDetail(id) {
	return request({
		url: `/h5/doc/detail/${id}`,
		'method': 'get'
	})
}

// 获取detail页面未签署人员集合
export function detailPage(data) {
	return request({
		url: '/h5/doc/detail/page',
		'method': 'get',
		'data': data
	})
}


// 上传签名
export function uploadSign(data) {
	return upload({
	  url: '/h5/doc/uploadSign',
	  'method': 'PUT',
	  name: data.name,
	  filePath: data.filePath
	})
}


// 更新用户签名状态
export function update(signUrl,docId) {
	return request({
		url: `/h5/doc/update?signUrl=${signUrl}&docId=${docId}`,
		'method': 'PUT'
	})
}
